<div class="box-body">
    <form class="layui-form" action="{:url('/fac/cash/save')}" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">收款方式</label>
            <div class="layui-input-block">
                <select name="cash_type" lay-search lay-reqText="收款方式必选" lay-verify="required" lay-filter="pay-type">
                    {foreach $cash_type as $k=>$v}
                    <option value="{$k}">{$v}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">收款账号</label>
            <div class="layui-input-block">
                <select name="account" lay-search lay-reqText="收款账号必选" lay-verify="required" lay-filter="act-account">
                    <option value="">请选择</option>
                    {foreach $banks as $bank}
                    <option value="{$bank.account}" {if $cash.account == $bank.account}selected{/if}>{$bank.name_acc}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">付款单位</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="付款单位"  name="pay_company" class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">付款账号</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="付款账号"  name="pay_account" class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">付款人</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="付款人"  name="pay_user" class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">应收金额</label>
            <div class="layui-input-block">
                <input type="number" readonly id="save-cash-money" autocomplete="off" name="cash_money" value="{$cash.cash_money|abs}" placeholder="应付金额" class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">手续费</label>
            <div class="layui-input-block">
                <input type="number" id="save-service-charge" value="0" autocomplete="off" placeholder="手续费"  name="service_charge" class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">实收金额</label>
            <div class="layui-input-block">
                <input type="number" autocomplete="off" id="save-real-money" value="{$cash.cash_money|abs}" placeholder="实付金额"  name="real_money" class="layui-input" />
            </div>
        </div>
        {if ($cash.is_invoice == 1)}
        <div class="layui-form-item">
            <label class="layui-form-label">发票抬头</label>
            <div class="layui-input-block">
                <select name="invoice_id" lay-search>
                    <option value="">请选择</option>
                    {foreach $invoices as $invoice}
                    <option {if $invoice.invoice_id == $cash.invoice_id}selected{/if} value="{$invoice.invoice_id}">{$invoice.title}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">发票金额</label>
            <div class="layui-input-block">
                <input type="number" autocomplete="off" name="invoice_money" value="{$cash.cash_money|abs}" placeholder="发票金额" class="layui-input" />
            </div>
        </div>
        {/if}
        <div class="layui-form-item">
            <label class="layui-form-label">税</label>
            <div class="layui-input-block">
                <input type="number" autocomplete="off" value="0" placeholder="实收金额税"  name="tax" class="layui-input" />
            </div>
        </div>
        <input type="hidden" name="cash_id" value="{$cash.cash_id}">
    </form>
</div>